package cn.tedu._03vehicle.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.NonNull;

@Data
public class UserRegParam {
    //@NotNull(message = "用户名不能为空")
    //@NotEmpty(message = "用户名不能为空字符串和null")
    //@NotBlank(message = "用户名不能为空字符串和null和空白字符串")
    //@Size(min = 6,max = 10,message = "用户名长度必须在6到10之间")
    @Pattern(regexp = "^([\\u4e00-\\u9fa5]{1,7}|[a-zA-Z]{1,14})$",message = "用户名最长不能超过7个汉字或14个英文字符")
    @Schema(description = "用户名", required = true)
    private String username;
    @Pattern(regexp = "^(?!.*[\\s\\u4e00-\\u9fa5])((?=.*[a-zA-Z])(?=.*[\\d])|(?=.*[a-zA-Z])(?=.*[\\p{Punct}])|(?=.*[\\d])(?=.*[\\p{Punct}]))[\\w\\p{Punct}]{8,14}$", message = "密码不合法")
    @Schema(description = "密码",required = true)
    private String password;
    //@Email(message = "邮箱格式不正确")
    @Pattern(regexp = "^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+$",message = "邮箱地址格式不正确")
    @Schema(description = "邮箱",required = true)
    private String email;
    @Schema(description = "手机号码",required = true)
    private String phone;

}
